home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / pp / pp-6.0 / Tools / misc / t-rtime.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-18  |  809 b   |  37 lines

  1. /* t-time.c: tests the time routines rfc2UTC and UTC2rfc */
  2.  
  3. # ifndef lint
  4. static char Rcsid[] = "@(#)$Header: /xtel/pp/pp-beta/Tools/misc/RCS/t-rtime.c,v 6.0 1991/12/18 20:31:14 jpo Rel $";
  5. # endif
  6.  
  7. /*
  8.  * $Header: /xtel/pp/pp-beta/Tools/misc/RCS/t-rtime.c,v 6.0 1991/12/18 20:31:14 jpo Rel $
  9.  *
  10.  * $Log: t-rtime.c,v $
  11.  * Revision 6.0  1991/12/18  20:31:14  jpo
  12.  * Release 6.0
  13.  *
  14.  */
  15.  
  16.  
  17.  
  18. #include "util.h"
  19.  
  20.  
  21. main ()
  22. {
  23.     char    buf[BUFSIZ];
  24.     UTC     ut;
  25.  
  26.     while (fputs ("UTC Time> ", stdout), fflush(stdout), gets (buf)) {
  27.         if ((ut = str2utct (buf, strlen(buf))) == NULLUTC)
  28.             printf ("str2utct failed\n");
  29.         printf ("UTC time = %s\n", utct2str (ut));
  30.         printf ("GEN time = %s\n", gent2str (ut));
  31.         if (UTC2rfc (ut, buf) == NOTOK)
  32.             printf ("UTC2rfc failed\n");
  33.         printf ("rfc = %s\n", buf);
  34.     }
  35.     exit (0);
  36. }
  37.